//
//  HEPublicDetailCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/11/11.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEPublicDetailCell.h"

@interface HEPublicDetailCell ()

@property(nonatomic, strong) UIImageView *arrowView;
@property(nonatomic, strong) UILabel *subLb;

@end

@implementation HEPublicDetailCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;

        [self initUI];
    }
    return self;
}

- (void)initUI {
    
    self.textLabel.font = DYFont(16);
    
    _arrowView = [UIImageView new];
    _arrowView.contentMode = UIViewContentModeScaleAspectFill;
    _arrowView.image = IMAGE_NAMED(@"go_gray");
    [self.contentView addSubview:_arrowView];
    
    [_arrowView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.right.equalTo(self.contentView).mas_offset(-15);
        make.width.mas_offset(8);
        make.height.mas_offset(12);
    }];
    
    
    _subLb = [UILabel new];
    _subLb.font = DYBlodFont(15);
    _subLb.text = @"-";
    _subLb.textColor = CNavDargGrayColor;
    [self.contentView addSubview:_subLb];
    
    [_subLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.right.equalTo(_arrowView.mas_left).mas_offset(-10);
    }];
    [_subLb setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
}


- (void)refreshContent:(GDFiterCellModel *)fiterModel formModel:(GDFormModel *)formModel indexPath:(NSIndexPath *)indexPath {
    self.textLabel.text = fiterModel.leftTitle;
    if (fiterModel.cellType == GDFiterCellTypeSettingCache) {
        _subLb.text = formModel.st_cache;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
